package com.team.bus.module.menu.service.impl;



import java.util.Arrays;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.zjframework.traceframe.common.dao.util.StringUtil;
import org.zjframework.traceframe.common.service.impl.CommonServiceImpl;

import com.team.bus.module.menu.dao.IMenuDao;
import com.team.bus.module.menu.service.IMenuService;

@Service("menuService")
public class MenuServiceImpl extends CommonServiceImpl implements IMenuService {

	
	private IMenuDao menuDao;

	public IMenuDao getMenuDao() {
		return menuDao;
	}

	@Resource
	public void setMenuDao(IMenuDao menuDao) {
		this.menuDao = menuDao;
	}

	@Override
	public String getnextnode(String taskname, String caseid) {	
		String nextname="";
		String nodenames[]={"生成立案相关文书","大队领导审批","分管副支队长审批","生成案件处理意见书相关文书","大队领导审批案件处理意见书","法制科审批案件处理意见书","副支队审批案件处理意见书","生成违法行为通知书、处罚决定书等文书","大队领导处理结案审核","法制科处理结案审核","支队长处理结案审核","重大讨论（收集各个角色意见）","强制执行","结案审批","分期、延期文书","分期处理","分期审批"};
		String nextnodes[]={"送大队领导审批","送分管副支队长审批","转承办人处理","送分管大队领导审批","送法制科审批","送分管副支队长审批","同意处理","送分管大队领导审批","送法制科审批","送支队长审批","结案","生成违法行为通知书","进入结案环节","大队领导处理结案审核","分期审批","结案审批","转承办人处理"};
		String prenodes[]={};
		List<String> tempList = Arrays.asList(nodenames);
		if(!StringUtil.isEmpty(taskname)){
		nextname=nextnodes[tempList.indexOf(taskname)];	
		}else{
			nextname="重大讨论";	
		}
		return nextname;
	}
	
	@Override
	public String getnextpersoncode(String taskname) {	
		String nextname="";
		String nodenames[]={"生成立案相关文书","大队领导审批","分管副支队长审批","生成案件处理意见书相关文书","大队领导审批案件处理意见书","法制科审批案件处理意见书","副支队审批案件处理意见书","生成违法行为通知书、处罚决定书等文书","大队领导处理结案审核","法制科处理结案审核","支队长处理结案审核","重大讨论（收集各个角色意见）"};
		String nextnodes[]={"150004","150002","150005","150004","150003","150002","150005","150004","150003","150001","150005","150005"};
		String prenodes[]={};
		List<String> tempList = Arrays.asList(nodenames);
		if(!StringUtil.isEmpty(taskname)){
		nextname=nextnodes[tempList.indexOf(taskname)];
		}
		return nextname;
	}
	
	
	public static void main(String args[]){
		
		
		String nodenames[]={"生成立案相关文书","大队领导审批","分管副支队长审批","生成案件处理意见书相关文书","大队领导审批案件处理意见书","法制科审批案件处理意见书","副支队审批案件处理意见书","生成违法行为通知书、处罚决定书等文书","大队领导处理结案审核","法制科处理结案审核","支队长处理结案审核"};
		String nextnodes[]={"送大队领导审批","送分管副支队长审批","转承办人处理","送分管大队领导审批","送法制科审批","送分管副支队长审批","同意处理","送分管大队领导审批","送法制科审批","送掌柜的审批","结案"};
		 List<String> tempList = Arrays.asList(nodenames);
		System.out.println(tempList.indexOf("生成案件处理意见书相关文书"));
		
	}

	@Override
	public String getqcnextnode(String taskname, String caseid) {
		// TODO Auto-generated method stub
		String nextname="";
		String nodenames[]={"强措立案审批","大队长立案审批","副支队长立案审批","强措审批","大队长强措审批","副支队长强措审批","一线扣押处理","延长强措审批","大队长延长强措审批","副支队长延长强措审批","解除强措审批","大队长解除强措审批","副支队长解除强措审批","强措结案审批","大队长强措结案审批","副支队长强措结案审批","强措结案报告"};
		String nextnodes[]={"送大队长立案审批","送副支队长立案审批","转承办人处理","送大队长强措审批","送副支队长强措审批","转承办人处理","转下一步审批","送大队长延长审批","送副支队长延长审批","转承办人处理","送大队长解除强措审批","送副支队长解除强措审批","转承办人处理","送大队长结案审批","送副支队长结案审批","转承办人处理","结案"};
		String prenodes[]={};
		List<String> tempList = Arrays.asList(nodenames);
		if(!StringUtil.isEmpty(taskname)){
		nextname=nextnodes[tempList.indexOf(taskname)];	
		}else{
			nextname="下一步";	
		}
		return nextname;
	}


	@Override
	public String getpbcnextnode(String taskname, String caseid) {
		// TODO Auto-generated method stub
		String nextname="";
		String nodenames[]={"赔补偿立案","大队领导立案审批","分管副支队长立案审批","生成赔补偿调查报告","大队长审批案件处理意见书","法制科审批案件处理意见书","副支队审批调查报告","生成赔补偿通知书","大队领导处理结案审核","法制科处理结案审核","支队长处理结案审核","启动民事诉讼","生成结案文书"};
		String nextnodes[]={"送大队长立案审批","送副支队长立案审批","转承办人处理","送大队长审批","送法制科审批","送副支队长审批","转承办人处理","送大队长结案审批","送法制科结案审批","送支队长结案审批","结案","进入结案环节","送大队长审批"};
		String prenodes[]={};
		List<String> tempList = Arrays.asList(nodenames);
		if(!StringUtil.isEmpty(taskname)){
			nextname=nextnodes[tempList.indexOf(taskname)];
		}else{
			nextname="下一步";
		}
		return nextname;
	}


	@Override
	public String getqzzxnextnode(String taskname, String caseid) {
		// TODO Auto-generated method stub
		String nextname="";
		String nodenames[]={"强制执行处理","强制执行公告","强制执行立案","大队领导立案审批","分管副支队长立案审批","强制执行审批","大队领导强制执行审批","副支队长强制执行审批","代履行决定书","代履行催告","代履行完毕确认","强制执行结案","大队领导结案审批","副支队长结案审批","结案报告"};
		String nextnodes[]={"进入结案处理","代履行完毕确认","大队领导立案审批","分管副支队长立案审批","同意立案","大队领导强制执行审批","副支队长强制执行审批","同意强制执行","代履行催告","强制执行公告","进入结案审批","大队领导结案审批","副支队长结案审批","同意结案","结案"};
		String prenodes[]={};
		List<String> tempList = Arrays.asList(nodenames);
		if(!StringUtil.isEmpty(taskname)){
			nextname=nextnodes[tempList.indexOf(taskname)];
		}else{
			nextname="下一步";
		}
		return nextname;
	}


	@Override
	public String getqzzxdlxnextnode(String taskname, String caseid) {
		// TODO Auto-generated method stub
		String nextname="";
		String nodenames[]={"现场笔录上传证件","确定当事人"};
		String nextnodes[]={"转事后通知书","结案"};
		String prenodes[]={};
		List<String> tempList = Arrays.asList(nodenames);
		if(!StringUtil.isEmpty(taskname)){
			nextname=nextnodes[tempList.indexOf(taskname)];
		}else{
			nextname="下一步";
		}
		return nextname;
	}


	@Override
	public String getqzzxcgnextnode(String taskname, String caseid) {
		// TODO Auto-generated method stub
		String nextname="";
		String nodenames[]={"金钱给付立案","大队长立案审批","行政机关立案审批","强制执行催告","第二次催告","申请强制执行","金钱给付结案","大队长结案审批","行政机关结案审批","结案报告处理"};
		String nextnodes[]={"大队长审批立案","副支队长审批立案","转承办人处理","二次催告","申请法院强制执行","结案审批","大队长结案审批","副支队长结案审批","转承办人生成结案报告","结案"};
		String prenodes[]={};
		List<String> tempList = Arrays.asList(nodenames);
		if(!StringUtil.isEmpty(taskname)){
			nextname=nextnodes[tempList.indexOf(taskname)];
		}else{
			nextname="下一步";
		}
		return nextname;
	}
	
	
	

}



